/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.api.config;

/**
 * Prototypical definition of a configuration property. Prototypes are used to define the attributes of configuration
 * properties, not the actual assigned extension values. Runtime definitions for a given prototype are stored using an
 * {@link IConfigProperty}.
 *
 * @author Tacoma Four
 */
public interface IConfigPropertyPrototype
{
    /**
     * Configuration property key.
     *
     * @return Property key, must not be null
     */
    String getKey();

    /**
     * Configuration property description, including type restrictions, formatting expectations, etc.
     *
     * @return Property description, or null if no description is provided
     */
    String getDescription();

    /**
     * Optional example that shows how the property value should be defined. For example, if the property is called
     * timestamp-format, the example can show the expected format of the timestamp.
     *
     * @return Optional example text, or null if no example is provided
     */
    String getExample();

    /**
     * Determines if the configuration property is mandatory or not.
     *
     * @return true, if configuration property is mandatory
     */
    boolean isMandatory();

    /**
     * Optional default value for the configuration property.
     *
     * @return Default value, or null if no default is provided
     */
    Object getDefaultValue();
}
